﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using System;
using QLNet;
using p = FinPlusCompQuant.QLConvParser;

namespace FinPlusCompQuant
{
    public static class QLDateParser
    {
        public static DateTime NextImmDate(DateTime date)
        {
            return IMM.nextDate(date);
        }

        public static DateTime NextBizDate(DateTime date, string period, string bizDayConv, bool endOfMonth, string holidays)
        {
            var calendar = p.Calendar(holidays);
            return calendar.advance(date, new Period(period), p.BizConv(bizDayConv), endOfMonth);
        }

        public static DateTime NextBizDate(DateTime date, string holidays)
        {
            var calendar = p.Calendar(holidays);
            return calendar.adjust(date);
        }
    }
}
